import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'home',
        component: HomeView,
        children: []
    },
    {
        /* 后台管理页面 */
        path: '/management',
        component: () => import("../views/sys-admin/Management"),
        children: [
            {
                /* 首页 */
                path: '/sys-admin/temp/index',
                component: () => import("../views/sys-admin/temp/index")
            },
            {
                /* 管理员列表 */
                path: '/sys-admin/temp/admin/list',
                component: () => import("../views/sys-admin/temp/AdminListView")
            },
            {
                /* 添加管理员 */
                path: '/sys-admin/temp/admin/new-add',
                component: () => import("../views/sys-admin/temp/AdminAddNewView")
            },
            {
                /* 用户列表 */
                path: '/sys-admin/temp/ums/list',
                component: () => import("../views/sys-admin/temp/UmsMemberListView")
            },
            {
                /* 品牌列表 */
                path: '/sys-admin/temp/brand/list',
                component: () => import("../views/sys-admin/temp/BrandListView")
            },
            {
                /* 添加品牌 */
                path: '/sys-admin/temp/brand/add-new',
                component: () => import("../views/sys-admin/temp/BrandAddNewView")
            },
            {
                /* 属性模板列表 */
                path: '/sys-admin/temp/template/list',
                component: () => import("../views/sys-admin/temp/TemplateListView")
            },
            {
                /* 添加属性模板 */
                path: '/sys-admin/temp/template/add-new',
                component: () => import("../views/sys-admin/temp/TemplateAddNewView")
            },
            {
                /* 属性列表 */
                path: '/sys-admin/temp/attribute/list',
                component: () => import("../views/sys-admin/temp/AttribnuteListView")
            },
            {
                /* 添加属性 */
                path: '/sys-admin/temp/attribute/add-new',
                component: () => import("../views/sys-admin/temp/AttribnuteAddNewView")
            }


        ]
    },
    {
        /* 商城首页 */
        path: '/shopping',
        component: () => import("../views/sys-shopping/shopping"),


    },
    {
      /* 购物车页面 */
        path: '/sys-shopping/temp/shoppingCart',
        component: ()=> import("../views/sys-shopping/temp/ShoppingCartView")
    },
    {
        /* 商品详情 */
        path: '/sys-shopping/temp/details',
        component: () => import("../views/sys-shopping/temp/DetailsView")
    },
    {
        /* 订单页面 */
        path: '/sys-shopping/temp/orders',
        component: () => import("../views/sys-shopping/temp/OrdersView")
    },
    {
        /* 登录界面 */
        path: '/login',
        component: () => import("../views/login")
    },
    {
        /* 注册界面 */
        path: '/reg',
        component: () => import("../views/reg")
    },
    {
      /* 结果页面 */
        path: '/results',
        component: () => import("../views/sys-shopping/temp/ResultsView")
    },
    {
        path: '/about',
        name: 'about',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
